// 
//  
//  Copyright (C) 2004-2009  Autodesk, Inc.
//  
//  This library is free software; you can redistribute it and/or
//  modify it under the terms of version 2.1 of the GNU Lesser
//  General Public License as published by the Free Software Foundation.
//  
//  This library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//  
//  You should have received a copy of the GNU Lesser General Public
//  License along with this library; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
//  
#include "stdafx.h"
#include "MapInfoConnectionCapabilities.h"

//-------------------------------------------------------
// Constructor / destructor
//-------------------------------------------------------


// default constructor
MapInfoConnectionCapabilities::MapInfoConnectionCapabilities()
{
}


// default destructor
MapInfoConnectionCapabilities::~MapInfoConnectionCapabilities()
{
}


//-------------------------------------------------------
// FdoIDisposable implementation
//-------------------------------------------------------


// dispose this object
void MapInfoConnectionCapabilities::Dispose()
{
    delete this;
}


//-------------------------------------------------------
// FdoIConnectionCapabilities implementation
//-------------------------------------------------------


// Gets a ThreadCapability value that declares the feature providers
// level of thread safety.
FdoThreadCapability MapInfoConnectionCapabilities::GetThreadCapability()
{
    return FdoThreadCapability_PerConnectionThreaded;
}


// Gets the list of spatial context extent types supported by the feature
// provider.  The length parameter gives the number of types in the list.
FdoSpatialContextExtentType* MapInfoConnectionCapabilities::GetSpatialContextTypes(FdoInt32& length)
{
    static FdoSpatialContextExtentType spatialTypes[] =
    {
        // MapInfo needs to set bounds of data when creating a MapInfo file. 
        // And coordinate value is saved as an integer. It is converted to
        // float value according to bounds. So once MapInfo file has some data,
        // we can't modify its bounds.
        FdoSpatialContextExtentType_Static,
        //FdoSpatialContextExtentType_Dynamic
    };

    length = sizeof(spatialTypes) / sizeof(FdoSpatialContextExtentType);
    return spatialTypes;
}


// Returns true if the feature provider supports persistent locking.
bool MapInfoConnectionCapabilities::SupportsLocking()
{
    return false;
}

// Returns a list of supported lock types; a null list for SDF
FdoLockType* MapInfoConnectionCapabilities::GetLockTypes(FdoInt32& size)
{
    size = 0;
    return NULL;
}

// Returns true if the feature provider supports connection timeout.
bool MapInfoConnectionCapabilities::SupportsTimeout()
{
    return false;
}


// Returns true if the feature provider supports transactions.
bool MapInfoConnectionCapabilities::SupportsTransactions()
{
    return false;
}


// Returns true if the feature provider supports long transactions.
bool MapInfoConnectionCapabilities::SupportsLongTransactions()
{
    return false;
}


// Returns true if the feature provider supports SQL commands.
bool MapInfoConnectionCapabilities::SupportsSQL()
{
    return false;
}

bool MapInfoConnectionCapabilities::SupportsConfiguration()
{
    return false;
}

bool MapInfoConnectionCapabilities::SupportsMultipleSpatialContexts()
{
    return true;
}

bool MapInfoConnectionCapabilities::SupportsCSysWKTFromCSysName()
{
    return false;
}

bool MapInfoConnectionCapabilities::SupportsWrite()
{
    return true;
}

bool MapInfoConnectionCapabilities::SupportsMultiUserWrite()
{
    return false;
}

bool MapInfoConnectionCapabilities::SupportsFlush() 
{ 
    return true; 
}
